function MainAssistant(argFromPusher) {}
var serverIP = "192.168.178.33:8080";
MainAssistant.prototype.setup = function() {
	Ares.setupSceneAssistant(this);
	this.controller.get("coverFlow").mojo.centerUrlProvided("http://" + serverIP + "/cover.jpg");
	this.controller.get("coverFlow").mojo.rightUrlProvided("images/rhythmbox-missing-artwork.png");
	this.controller.get("coverFlow").mojo.leftUrlProvided("images/rhythmbox-missing-artwork.png");
	new Ajax.Request('http://' + serverIP + '/isPlaying', {
		method: 'get',
		onSuccess: this.updatePlayButton.bind(this)
	});
	new Ajax.Request('http://' + serverIP + '/currentSong', {
		method: 'get',
		onSuccess: this.updateLabel.bind(this)
	});
};
MainAssistent.prototype.cleanup = function() {
	Ares.cleanupSceneAssistant(this);
};
MainAssistent.prototype.coverFlowLeftFunction = function(inSender) {
	// call leftUrlProvided and/or centerUrlProvided as in this example:
	new Ajax.Request('http://' + serverIP + '/prev', {
		method: 'get',
		on304: function(transport) {
			this.controller.get("coverFlow").mojo.centerUrlProvided("http://" + serverIP + "/cover.jpg");
		}
	});
	new Ajax.Request('http://' + serverIP + '/currentSong', {
		method: 'get',
		onSuccess: this.updateLabel.bind(this)
	});
};
MainAssistent.prototype.coverFlowRightFunction = function(inSender) {
	// call rightUrlProvided and/or centerUrlProvided as in this example:
	// this.controller.get("imageView1").mojo.rightUrlProvided("images/picture.jpg")
	new Ajax.Request('http://' + serverIP + '/next', {
		method: 'get',
		on304: this.updateCoverFlow.bind(this)
	});
	new Ajax.Request('http://' + serverIP + '/currentSong', {
		method: 'get',
		onSuccess: this.updateLabel.bind(this)
	});
};
MainAssistent.prototype.prevTap = function(inSender, event) {
	new Ajax.Request('http://' + serverIP + '/prev', {
		method: 'get',
		on304: function(transport) {}
	});
	new Ajax.Request('http://' + serverIP + '/currentSong', {
		method: 'get',
		onSuccess: this.updateLabel.bind(this)
	});
	this.controller.get("coverFlow").mojo.centerUrlProvided("http://" + serverIP + "/cover.jpg");
};
MainAssistent.prototype.playTap = function(inSender, event) {
	new Ajax.Request('http://' + serverIP + '/play', {
		method: 'get',
		on304: function(transport) {}
	});
	new Ajax.Request('http://' + serverIP + '/isPlaying', {
		method: 'get',
		onSuccess: this.updatePlayButton.bind(this)
	});
};
MainAssistent.prototype.nextTap = function(inSender, event) {
	new Ajax.Request('http://' + serverIP + '/next', {
		method: 'get',
		on304: function(transport) {}
	});
	new Ajax.Request('http://' + serverIP + '/currentSong', {
		method: 'get',
		onSuccess: this.updateCoverFlow.bind(this)
	});
	this.updateCoverFlow();
};
MainAssistent.prototype.updateCoverFlow = function(transport) {
	this.controller.get("coverFlow").mojo.centerUrlProvided("http://" + serverIP + "/cover.jpg");
	this.controller.get("coverFlow").mojo.rightUrlProvided("images/rhythmbox-missing-artwork.png");
};
MainAssistent.prototype.updatePlayButton = function(transport) {
	var buttonModel = {
		label: "||"
	};
	if (transport.responseText == "true") {
		buttonModel = {
			label: "||"
		};
		this.controller.get("play").mojo.modelChanged(buttonModel);
	} else {
		buttonModel = {
			label: ">"
		};
		this.controller.get("play").mojo.modelChanged(buttonModel);
	}
};
MainAssistent.prototype.updateLabel = function(transport) {
	this.controller.get("songDetails").setLabel(transport.responseText);
};